<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org" lang="zh">
<head th:replace="common/header::header"/>
<body>
<article class="page-container">
    <form class="form form-horizontal" id="form-emp-add">
        <span th:if="${staff}">
            <input type="hidden" name="empId" id="empId" th:value="${staff.empId}"/>
            <input type="hidden" name="empNum" id="empNum" th:value="${staff.empNum}"/>
            <input type="hidden" name="userPassword" id="userPassword1" th:value="${staff.userPassword}"/>
            <input type="hidden" name="userId" id="userId" th:value="${staff.userId}"/>
            <input type="hidden" name="empParamId" id="empParamId" th:value="${staff.empParamId}"/>
            <input type="hidden" name="userRoleId" id="userRoleId" th:value="${staff.userRoleId}"/>
            <input type="hidden" name="uStatus" id="uStatus" th:value="${staff.uStatus}"/>
        </span>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>员工姓名：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <input type="text" class="input-text" value="" placeholder="" id="empName" name="empName" th:attr="value=(${staff}?(${staff.empName}):'')" style="width: 410px"/>
            </div>
        </div>
        <div th:unless="${staff}">
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>密码：</label>
                <div class="formControls col-xs-8 col-sm-8">
                    <input type="password" class="input-text" autocomplete="off" placeholder="密码" id="userPassword" name="userPassword" style="width: 410px"/>
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>确认密码：</label>
                <div class="formControls col-xs-8 col-sm-8">
                    <input type="password" class="input-text" autocomplete="off"  placeholder="确认密码" id="userPassword2" name="userPassword2" style="width: 410px"/>
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>性别：</label>
                <div class="formControls col-xs-8 col-sm-8">
                    <select class="input-text" id="sex" name="sex" style="width: 410px">
                        <option value="男">男</option>
                        <option value="女">女</option>
                    </select>
                </div>
            </div>
        </div>
        <span th:if="${staff}">
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>性别：</label>
                <div class="formControls col-xs-8 col-sm-8">
                    <select class="input-text" id="sex1" name="sex" style="width: 410px">
                        <option th:value="${staff.sex}" th:text="${staff.sex}"></option>
                        <option value="男">男</option>
                        <option value="女">女</option>
                    </select>
                </div>
            </div>
        </span>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>年龄：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <input type="text" class="input-text" value="" placeholder="" id="age" name="age" th:attr="value=(${staff}?(${staff.age}):'')" style="width: 410px"/>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>家庭住址：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <input type="text" class="input-text" value="" placeholder="" id="address" name="address" th:attr="value=(${staff}?(${staff.address}):'')" style="width: 410px"/>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>邮箱：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <input type="text" class="input-text" value="" placeholder="" id="email" name="email" th:attr="value=(${staff}?(${staff.email}):'')" style="width: 410px"/>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>电话号码：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <input type="text" class="input-text" name="phone" id="phone" th:attr="value=(${staff}?(${staff.phone}):'')" style="width: 410px"/>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>民族：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <input type="text" class="input-text" placeholder="" id="pace" name="pace" th:attr="value=(${staff}?(${staff.pace}):'')" style="width: 410px"/>
            </div>
        </div>
        <div th:if="${staff}">
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>部门名称：</label>
                <div class="formControls col-xs-8 col-sm-8">
                <span class="select-box" style="width:410px;">
                    <select class="select" name="deptId" size="1" onchange="changeJobName(this.value)">
                        <option th:value="${staff.deptId}" th:text="${staff.deptName}"></option>
                        <option th:each="deptItem:${deptList}" th:text="${deptItem.deptName}" th:value="${deptItem.deptId}"></option>
                    </select>
			    </span>
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>职位名称：</label>
                <div class="formControls col-xs-8 col-sm-8">
                <span class="select-box" style="width:410px;">
                    <select class="select" name="jobId" size="1">
                        <option th:value="${staff.jobId}" th:text="${staff.jobName}"></option>
                        <option th:each="jobItem:${jobList}" th:value="${jobItem.jobId}" th:text="${jobItem.jobName}"></option>
                    </select>
			    </span>
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>是否在职：</label>
                <div class="formControls col-xs-8 col-sm-8">
                    <span class="select-box" style="width:410px;">
                        <select class="select" name="eStatus" size="1">
                            <option th:text="${staff.eStatus}==1?'正常':'异常'" th:attr="value=${staff.eStatus}"></option>
                        <option th:text="${staff.eStatus}==0?'正常':'异常'" th:attr="value=(${staff.eStatus}==1?'0':'1')"></option>
                        </select>
                    </span>
                </div>
            </div>
        </div>
        <div th:unless="${staff}">
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>部门名称：</label>
                <div class="formControls col-xs-8 col-sm-8">
                <span class="select-box" style="width:410px;">
                    <select id="deptId" class="select" name="deptId" size="1" onchange="changeJobName(this.value)">
                        <option value="">---请选择所属部门---</option>
                        <option th:each="deptItem:${deptList}" th:text="${deptItem.deptName}" th:value="${deptItem.deptId}"></option>
                    </select>
			    </span>
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>职位名称：</label>
                <div class="formControls col-xs-8 col-sm-8">
                <span class="select-box" style="width:410px;">
                    <select id="jobId" class="select" name="jobId" size="1">
                        <option value="">---请选择所属职位---</option>
                    </select>
			    </span>
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>是否在职：</label>
                <div class="formControls col-xs-8 col-sm-8">
                    <span class="select-box" style="width:410px;">
                        <select class="select" name="eStatus" size="1">
                            <option value="0">异常</option>
                            <option value="1">正常</option>
                        </select>
                    </span>
                </div>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">备注：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <textarea name="remark" id="remark" class="textarea"  placeholder="" th:text="${staff}?(${staff.remark}):''" style="width: 410px"></textarea>
            </div>
        </div>
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <input class="btn btn-primary radius" type="submit" id="sub" value="&nbsp;&nbsp;提交&nbsp;&nbsp;"/>
                <button onclick="layer_close()" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
            </div>
        </div>
    </form>
</article>
<script th:src="@{/js/emp/empAdd.js}" th:inline="javascript"/>
</body>
</html>